package domain;

public class ModelObject {
	
	private Integer id;
	private Integer version;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	/**
	 * @return the version
	 */
	public Integer getVersion() {
		return version;
	}

	/**
	 * @param version the version to set
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}
	
	public void incVersion() {
		this.version++;
	}

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof ModelObject))
			return false;
		ModelObject mo = (ModelObject) o;
		if (mo.getId().equals(this.id)) return true;
		return false;
	}
	
}
